# Contributor: omni <omni+alpine@hack.org>
# Maintainer: omni <omni+alpine@hack.org>
pkgname=arti
pkgver=0.5.0
pkgrel=0
pkgdesc="An implementation of Tor, in Rust"
# s390x and riscv64 blocked by cargo
# ppc64le blocked by ring crate
arch="all !s390x !riscv64 !ppc64le"
url="https://docs.rs/arti/latest/arti/"
license="GPL-3.0-or-later"
makedepends="cargo openssl-dev sqlite-dev zstd-dev xz-dev"
source="$pkgname-$pkgver.tar.gz::https://gitlab.torproject.org/tpo/core/arti/-/archive/arti-v$pkgver/arti-arti-v$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgname-v$pkgver"

prepare() {
	default_prepare
	cargo fetch --locked
}

build() {
	cargo build --release --frozen
}

check() {
	cargo test --frozen
}

package() {
	install -Dm0755 target/release/arti -t "$pkgdir"/usr/bin
}

sha512sums="
60f1bf1fa3d01451293e5596c48e999de6330c44c4324e3a1199fb6ab85847dc84a13c2a8b8c2b0319ae179b2321fdc4f8fe16011fa06593952e2568f1b96c7e  arti-0.5.0.tar.gz
"
